<?php
class It_Form_Changepass extends Zend_Form
{

    public function init()
    {
        $passwordOld = new Zend_Form_Element_Password('passwordOld');
        $passwordOld->setLabel('Mật khẩu cũ')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
        $passwordOld->setAttrib('size', 60);
         
        $passwordNew = new Zend_Form_Element_Password('passwordNew');
        $passwordNew->setLabel('Mật khẩu mới')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
        $passwordNew->setAttrib('size', 60);
        
        $passwordRetype = new Zend_Form_Element_Password('passwordRetype');
        $passwordRetype->setLabel('Xác nhận mật khẩu mới')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
        $passwordRetype->setAttrib('size', 60);

        // submit button
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id','submitbutton');
        $submit->setAttrib('class',"button medium");
        // add elements to form
        $hash = new Zend_Form_Element_Hash('no_csrf_foo');
        $this->addElement('hash','no_csrf_foo',array (
            'salt' => 'T1EJtbLm40sRWNsj'
        ));
        $this->addElements(array (
            $passwordOld, $passwordNew, $passwordRetype, $submit
        ));
    }
}

